package com.htc.android.footprints.utils;

import java.io.File;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.htc.android.footprints.provider.FootprintsProvider;

public class FootprintDBScanner extends BroadcastReceiver
{
  private static final String TAG = "FootprintDBScanner";

  public void onReceive(Context paramContext, Intent paramIntent)
  {
    Log.d("FootprintDBScanner", "FootprintDBScanner onReceive(android.intent.action.MEDIA_MOUNTED), sync db now!");
    if (StorageUtil.hasExternalStorage())
      new Thread(paramContext)
      {
        public void run()
        {
          try
          {
            Thread.sleep(30L);
            FootprintUtils.touchSDFile();
            File localFile = new File(FootprintUtils.getDBPathOnSD());
            if ((localFile.exists()) && (localFile.length() > 0L) && (FootprintUtils.getExtDBVersion() == 36))
            {
              if (FootprintUtils.copyFile(localFile, this.val$context.getDatabasePath("footprints.db")))
                this.val$context.getContentResolver().notifyChange(FootprintsProvider.FootprintColumns.CONTENT_URI, null);
              return;
            }
          }
          catch (InterruptedException localInterruptedException)
          {
            while (true)
            {
              localInterruptedException.printStackTrace();
              continue;
              FootprintUtils.processPreset(this.val$context);
            }
          }
        }
      }
      .start();
  }
}

/* Location:           E:\workspace\dex2java\dex-translator-0.0.9.3\HtcFootprints_dex2jar.jar
 * Qualified Name:     com.htc.android.footprints.utils.FootprintDBScanner
 * JD-Core Version:    0.6.0
 */